package com.zhuiyun.pm.sys.bidmanagement.service.impl;/**
 * @Description:
 * @ClassName: PublishServiceImpl
 * @Author: YB
 * @Date: 2023/3/14 8:32
 * @Version: 1.0
 */


import com.zhuiyun.pm.page.MyPageHelper;
import com.zhuiyun.pm.page.PageRequest;
import com.zhuiyun.pm.page.PageResult;
import com.zhuiyun.pm.sys.bidmanagement.entity.GoodsInfo;
import com.zhuiyun.pm.sys.bidmanagement.mapper.GoodsInfoMapper;
import com.zhuiyun.pm.sys.bidmanagement.service.GoodsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ClassName PublishServiceImpl
 * @Description TODO
 * @Author yuanb
 * @Date 2023/3/14 8:32
 **/
@Service
public class GoodsInfoServiceImpl implements GoodsInfoService {

    @Autowired
    private GoodsInfoMapper goodsInfoMapper;
    /**
     * @param pageRequest
     * @Author yb
     * @Description
     * @Date 2023/3/14 9:18
     * @Return com.zhuiyun.pm.page.PageResult
     * 竞拍管理全查
     */
    @Override
    public PageResult goodsInfoSelectAll(GoodsInfo goodsInfo, PageRequest pageRequest) {
        MyPageHelper.startPage(pageRequest);
        List<GoodsInfo> goodsInfos = goodsInfoMapper.goodsInfoSelectAll(goodsInfo,pageRequest);
        return MyPageHelper.pageInfo(goodsInfos);
    }

    /**
     * @Author yuanb
     * @Description
     * @Date 2023/3/15 8:37
     * @Return int
     * @param id
     * 修改审核成功
     */
    @Override
    public int goodsInfoUpdatePass(Integer id) {
        int i= goodsInfoMapper.goodsInfoUpdatePass(id);
        return i;
    }

    /**
     * @Author yuanb
     * @Description
     * @Date 2023/3/15 8:40
     * @Return int
     * @param id
     * 修改驳回
     */
    @Override
    public int goodsInfoUpdateReject(Integer id) {
        int i = goodsInfoMapper.goodsInfoUpdateReject(id);
        return i;
    }

    /**
     * @param id
     * @Author yuanb
     * @Description
     * @Date 2023/3/15 8:37
     * @Return int
     * 修改二次审核成功
     */
    @Override
    public int goodsInfoUpdateSecondary(Integer id) {
        int i = goodsInfoMapper.goodsInfoUpdateSecondary(id);
        return i;
    }

    /**
     * @param id
     * @Author yuanb
     * @Description
     * @Date 2023/3/15 8:40
     * @Return int
     * 修改二次驳回
     */
    @Override
    public int goodsInfoUpdateRejectSecondary(Integer id) {
        int i =goodsInfoMapper.goodsInfoUpdateRejectSecondary(id);
        return i;
    }

    /**
     * @param goodsInfo
     * @Author yuanb
     * @Description
     * @Date 2023/4/1 9:31
     * @Return int
     * * @param goodsInfo
     * 竞品跟踪
     */
    @Override
    public PageResult goodsInfoFollow(GoodsInfo goodsInfo, PageRequest pageRequest) {
        MyPageHelper.startPage(pageRequest);
        List<GoodsInfo> goodsInfos = goodsInfoMapper.goodsInfoFollow(goodsInfo,pageRequest);
        return MyPageHelper.pageInfo(goodsInfos);
    }

    /**
     * @param id
     * @Author yuanb
     * @Description
     * @Date 2023/4/1 10:21
     * @Return int
     * * @param id
     * 竞品下架
     */
    @Override
    public int goodsInfoUndercarriage(Integer id) {
        int i= goodsInfoMapper.goodsInfoUndercarriage(id);
        return i;
    }

}
